<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@ page import="java.util.*"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>



<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href="dist/css/starter-template.css" rel="stylesheet">

<script
	src="dist/bootstrap-duallistbox-master/libraries/modernizr/modernizr-custom.min.js"></script>

<link href="../dist/css/bootstrap.css" rel="stylesheet" type="text/css"
	media="all">
<link href="../dist/css/bootstrap-theme.css" rel="stylesheet"
	type="text/css" media="all">
<link
	href="../dist/bootstrap-duallistbox-master/libraries/prettify/prettify.css"
	rel="stylesheet" type="text/css" media="all">
<link
	href="../dist/bootstrap-duallistbox-master/bootstrap-duallistbox/bootstrap-duallistbox.css"
	rel="stylesheet" type="text/css" media="all">

<script src="../dist/js/jquery-1.9.1.min.js"></script>
<script
	src="../dist/bootstrap-duallistbox-master/libraries/prettify/prettify.js"></script>
<script
	src="../dist/bootstrap-duallistbox-master/bootstrap-duallistbox/jquery.bootstrap-duallistbox.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>

<body>
	<%
		Calendar cal = Calendar.getInstance();
		Date dt = new Date();

		SimpleDateFormat sdf = new SimpleDateFormat("dd");

		int selDate = Integer.parseInt(sdf.format(dt));

		sdf = new SimpleDateFormat("MMM , yyyy");

		String str = request.getParameter("selectedDate");
		if (str != null)
			selDate = Integer.parseInt(str);
	%>
	<div class="container">
		<h3>Select the people worked/working from home</h3>
		<h4><%=sdf.format(dt)%></h4>
		<div class="list">
			<ul class="pagination pagination-sm">
				<!-- <li ><a href="#">&laquo;</a></li> -->
				<%
					for (int i = 1; i <= cal.getActualMaximum(Calendar.DAY_OF_MONTH); i++) {
						if (i == selDate) {
				%>
				<li class="active"><a href="#"><%=selDate%> <span
						class="sr-only">(current)</span></a></li>
				<%
					} else {
				%>
				<li><a href="showWorkFromHomeScreen?selectedDate=<%=i%>"><%=i%></a></li>
				<%
					}
					}
				%>

				<!-- <li><a href="#">&raquo;</a></li> -->
			</ul>
		</div>
		<hr>


		<div style="width: 50%; margin-left: 250px">
			<form id="demoform" action="#" method="post">
				<%
					session.setAttribute("selectedDate", selDate);
				%>

				<select multiple="multiple" size="10" name="duallistbox_demo1[]">
					<s:iterator value="#session.allUsersInArray" var="row">
						<s:iterator value="row" var="x">
							<c:if test="${x != null}">
								<c:if test="${x.workFromHome == false}">

									<option value="<s:property value="id"/>"><s:property
											value="firstname" /><s:property value="lastname" />
									</option>
								</c:if>
							</c:if>
						</s:iterator>
					</s:iterator>

				</select> <br>
				<button type="submit" class="btn btn-default btn-block">Submit
					data</button>
			</form>

		</div>
	</div>
</body>
<script>
	var demo1 = $('[name="duallistbox_demo1[]"]').bootstrapDualListbox();
	$("#demoform").submit(function() {

		alert($('[name="duallistbox_demo1[]"]').val());
		return false;
	});
</script>


<script src="libraries/jquery-placeholder/jquery.placeholder.js"></script>

<script>
	$('input').placeholder();
	prettyPrint();
</script>
</html>